<?php
session_start();
include_once ('class_master/db.class.php');
include_once ('class_master/parcourir.class.php');

$host="localhost";

$db_name="monitor";
$tbl_name="admin";


$result="";
$req = new db();
$var = new parcourir();
$res = $req->select('login_admin, password_admin ' , 'admin', " login_admin = '".$_SESSION['login']."' and password_admin = '".$_SESSION['pwd']."' ");
$result = $var->get_uniques($res);


echo $result;
if (!empty($_SESSION['login']) || !empty($_SESSION['pwd'])){
    $verif = $_SESSION['login'].$_SESSION['pwd'];
    if ($verif == $result){
        $_SESSION['admin'] = true;
        header("Location: gestion_salle.php");
    }else{  
        echo "Erreur de connexion !!";
    }
}else{
    echo "Erreur de connexion !!";
}
?>